package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;


/**
 * The persistent class for the FICHA database table.
 * 
 */
@Entity
@Table(name="FICHA")
public class Ficha implements Serializable {
	private static final long serialVersionUID = 1L;
	private long refnumPart;
	private String agntSync;
	private String ficha;
	private String fichaBis;
	private BigDecimal idImgFicha;
	private BigDecimal numpag;
	private Date tsUltSync;
	private Partida partida;

    public Ficha() {
    }


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="REFNUM_PART", unique=true, nullable=false)
	public long getRefnumPart() {
		return this.refnumPart;
	}

	public void setRefnumPart(long refnumPart) {
		this.refnumPart = refnumPart;
	}


	@Column(name="AGNT_SYNC", length=4)
	public String getAgntSync() {
		return this.agntSync;
	}

	public void setAgntSync(String agntSync) {
		this.agntSync = agntSync;
	}


	@Column(nullable=false, length=10)
	public String getFicha() {
		return this.ficha;
	}

	public void setFicha(String ficha) {
		this.ficha = ficha;
	}


	@Column(name="FICHA_BIS", nullable=false, length=1)
	public String getFichaBis() {
		return this.fichaBis;
	}

	public void setFichaBis(String fichaBis) {
		this.fichaBis = fichaBis;
	}


	@Column(name="ID_IMG_FICHA")
	public BigDecimal getIdImgFicha() {
		return this.idImgFicha;
	}

	public void setIdImgFicha(BigDecimal idImgFicha) {
		this.idImgFicha = idImgFicha;
	}


	@Column(precision=3)
	public BigDecimal getNumpag() {
		return this.numpag;
	}

	public void setNumpag(BigDecimal numpag) {
		this.numpag = numpag;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_ULT_SYNC")
	public Date getTsUltSync() {
		return this.tsUltSync;
	}

	public void setTsUltSync(Date tsUltSync) {
		this.tsUltSync = tsUltSync;
	}


	//bi-directional one-to-one association to Partida
	@OneToOne
	@JoinColumn(name="REFNUM_PART", nullable=false, insertable=false, updatable=false)
	public Partida getPartida() {
		return this.partida;
	}

	public void setPartida(Partida partida) {
		this.partida = partida;
	}
	
}